#include <stdio.h>

__global__ void Kernel(float * pData, int rank, int n)
{
	int tid = threadIdx.x + blockIdx.x * blockDim.x;

	if (tid < n) pData[tid] =  tid * rank;
}

void Kernel_Wrapper(float * pData, int rank, int n)
{
	int block = n / 32;

	Kernel<<<dim3(block), dim3(32)>>>(pData, rank, n);

	cudaError err = cudaThreadSynchronize();

	fprintf(stderr, "Error %s \n", cudaGetErrorString(err));
}